

window.addEvent('domready', function(e){
	 var old_cms=$('cms').value;
	 ///////////////////////////////////////////
	 ///////////////////////////////////////////
	 getCms();
	$('cms_config').addEvent('click',function(e){
		//abc=$clear(abc);
		var cms=$('cms').value;
		if(old_cms==cms)
			return;
		getCms();
	});
	function getCms()
	{
		$('job_config_cms').style.display="none";
		var cms=$('cms').value;
		var now = new Date();
		var url = 'index.php';
		var cid=$('cid').value;	
		var data=Object.toQueryString({option: 'com_feed_manager',task: 'jobs.getcms_config_job',cid: cid,cms: cms,tmpl:'component',s: now.getTime()});
		var MyAjax_detail = new Ajax(url, {
			method: 'get',
			data: data,
			update:$('job_config_cms'),
			evalScripts: true,
			onRequest: function(){				
				$('job_config_cms').parentNode.style.display = 'none';
				$('cms_config').removeClass('open');
			},
			onComplete: function(){						
				old_cms=$('cms').value;
					 window.addEvent('domready', function(){ 
					 	var JTooltips = new Tips(
					 		$$('.hasTip'),
					 		{
					 			maxTitleChars: 50, 
					 			fixed: false
					 		});
					 }); 
				$('job_config_cms').style.display="block";
			}
		});		
		MyAjax_detail.request();
	}
	
/////////////////////////////////
/////////////////////////////////
	checkTrans();
	$('trans').addEvent('click',function(e,b){
		checkTrans();
	});	
	function checkTrans()
	{
		if($('trans').checked==false)
		{
			$('t_from').disabled=true;
			$('t_to').disabled=true;
		}else{
			$('t_from').disabled=false;
			$('t_to').disabled=false;
		}
	}	
});